package com.shuimutong.paxos.demo.bean.dto;

import lombok.Getter;
import lombok.Setter;

@Getter
@Setter
public class ReqResult<T> {
    public final static int CODE_OK = 200;
    public final static int PARAM_ERR = 400;
    public final static int SYS_ERR = 500;

    private int code = SYS_ERR;
    private String msg;
    private T data;

    public ReqResult() {
    }

    public ReqResult(int code, String msg) {
        this.code = code;
        this.msg = msg;
    }

    public ReqResult(T t) {
        this.code = CODE_OK;
        this.msg = "ok";
        this.data = t;
    }
}
